.class public Lcom/esfile/screen/recorder/picture/pngj/h;
.super Ljava/lang/Object;
.source "PngWriter.java"


# instance fields
.field public final a:Lcom/esfile/screen/recorder/picture/pngj/c;

.field protected b:I

.field private final c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

.field protected d:I

.field private e:I

.field private f:I

.field private g:Z

.field private h:I

.field protected i:Les/fb;

.field private final j:Ljava/io/OutputStream;

.field private k:Lcom/esfile/screen/recorder/picture/pngj/chunks/b;

.field private l:Lcom/esfile/screen/recorder/picture/pngj/chunks/d;


# direct methods
.method public constructor <init>(Ljava/io/File;Lcom/esfile/screen/recorder/picture/pngj/c;)V
    .locals 1

    const/4 v0, 0x1

    .line 3
    invoke-direct {p0, p1, p2, v0}, Lcom/esfile/screen/recorder/picture/pngj/h;-><init>(Ljava/io/File;Lcom/esfile/screen/recorder/picture/pngj/c;Z)V

    return-void
.end method

.method public constructor <init>(Ljava/io/File;Lcom/esfile/screen/recorder/picture/pngj/c;Z)V
    .locals 0

    .line 1
    invoke-static {p1, p3}, Lcom/esfile/screen/recorder/picture/pngj/f;->a(Ljava/io/File;Z)Ljava/io/OutputStream;

    move-result-object p1

    invoke-direct {p0, p1, p2}, Lcom/esfile/screen/recorder/picture/pngj/h;-><init>(Ljava/io/OutputStream;Lcom/esfile/screen/recorder/picture/pngj/c;)V

    const/4 p1, 0x1

    .line 2
    invoke-virtual {p0, p1}, Lcom/esfile/screen/recorder/picture/pngj/h;->a(Z)V

    return-void
.end method

.method public constructor <init>(Ljava/io/OutputStream;Lcom/esfile/screen/recorder/picture/pngj/c;)V
    .locals 2

    .line 4
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, -0x1

    .line 5
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    .line 6
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    const/4 v0, 0x1

    .line 7
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->e:I

    const/4 v1, 0x0

    .line 8
    iput v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->f:I

    .line 9
    iput-boolean v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->g:Z

    .line 10
    iput v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->h:I

    const/4 v0, 0x0

    .line 11
    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->k:Lcom/esfile/screen/recorder/picture/pngj/chunks/b;

    .line 12
    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->l:Lcom/esfile/screen/recorder/picture/pngj/chunks/d;

    .line 13
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    .line 14
    iput-object p2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    .line 15
    new-instance p1, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    invoke-direct {p1, p2}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;-><init>(Lcom/esfile/screen/recorder/picture/pngj/c;)V

    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    .line 16
    new-instance v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/l;

    invoke-direct {v0, p1}, Lcom/esfile/screen/recorder/picture/pngj/chunks/l;-><init>(Lcom/esfile/screen/recorder/picture/pngj/chunks/d;)V

    .line 17
    invoke-virtual {p0, p2}, Lcom/esfile/screen/recorder/picture/pngj/h;->a(Lcom/esfile/screen/recorder/picture/pngj/c;)Les/fb;

    move-result-object p1

    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    const/16 p1, 0x9

    .line 18
    invoke-virtual {p0, p1}, Lcom/esfile/screen/recorder/picture/pngj/h;->a(I)V

    return-void
.end method

.method private c()V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    invoke-virtual {v0, v1}, Les/fb;->a(Ljava/io/OutputStream;)V

    .line 2
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    iget v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->h:I

    invoke-virtual {v0, v1}, Les/fb;->a(I)V

    .line 3
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->h()V

    .line 4
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->f()V

    return-void
.end method

.method private d()V
    .locals 6

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->l:Lcom/esfile/screen/recorder/picture/pngj/chunks/d;

    if-eqz v0, :cond_7

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->k:Lcom/esfile/screen/recorder/picture/pngj/chunks/b;

    if-nez v0, :cond_0

    goto/16 :goto_2

    .line 2
    :cond_0
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    const/4 v1, 0x4

    if-lt v0, v1, :cond_1

    const/4 v0, 0x1

    goto :goto_0

    :cond_1
    const/4 v0, 0x0

    .line 3
    :goto_0
    iget-object v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->l:Lcom/esfile/screen/recorder/picture/pngj/chunks/d;

    invoke-virtual {v2}, Lcom/esfile/screen/recorder/picture/pngj/chunks/d;->a()Ljava/util/List;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_2
    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_7

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;

    .line 4
    invoke-virtual {v3}, Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;->g()Lcom/esfile/screen/recorder/picture/pngj/chunks/c;

    move-result-object v4

    iget-object v4, v4, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;->d:[B

    if-nez v4, :cond_3

    goto :goto_1

    .line 5
    :cond_3
    invoke-virtual {v3}, Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;->c()I

    move-result v4

    if-gt v4, v1, :cond_4

    if-eqz v0, :cond_4

    goto :goto_1

    :cond_4
    if-lt v4, v1, :cond_5

    if-nez v0, :cond_5

    goto :goto_1

    .line 6
    :cond_5
    iget-boolean v4, v3, Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;->b:Z

    if-eqz v4, :cond_6

    iget-object v4, v3, Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;->a:Ljava/lang/String;

    const-string v5, "PLTE"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_6

    goto :goto_1

    .line 7
    :cond_6
    iget-object v4, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->k:Lcom/esfile/screen/recorder/picture/pngj/chunks/b;

    invoke-interface {v4, v3}, Lcom/esfile/screen/recorder/picture/pngj/chunks/b;->a(Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 8
    iget-object v4, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    invoke-virtual {v4, v3}, Lcom/esfile/screen/recorder/picture/pngj/chunks/d;->a(Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;)Ljava/util/List;

    move-result-object v4

    invoke-interface {v4}, Ljava/util/List;->isEmpty()Z

    move-result v4

    if-eqz v4, :cond_2

    iget-object v4, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    .line 9
    invoke-virtual {v4, v3}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;->b(Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;)Ljava/util/List;

    move-result-object v4

    invoke-interface {v4}, Ljava/util/List;->isEmpty()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 10
    iget-object v4, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    invoke-virtual {v4, v3}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;->c(Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;)Z

    goto :goto_1

    :cond_7
    :goto_2
    return-void
.end method

.method private e()V
    .locals 3

    const/4 v0, 0x6

    .line 1
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    .line 2
    new-instance v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/f;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    invoke-direct {v0, v1}, Lcom/esfile/screen/recorder/picture/pngj/chunks/f;-><init>(Lcom/esfile/screen/recorder/picture/pngj/c;)V

    .line 3
    invoke-virtual {v0}, Lcom/esfile/screen/recorder/picture/pngj/chunks/f;->b()Lcom/esfile/screen/recorder/picture/pngj/chunks/c;

    move-result-object v1

    iget-object v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    invoke-virtual {v1, v2}, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;->a(Ljava/io/OutputStream;)V

    .line 4
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    invoke-virtual {v1}, Lcom/esfile/screen/recorder/picture/pngj/chunks/d;->a()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method private f()V
    .locals 3

    .line 1
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    const/4 v1, 0x4

    if-lt v0, v1, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x1

    .line 2
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    .line 3
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->d()V

    .line 4
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    iget v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    invoke-virtual {v0, v1, v2}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;->a(Ljava/io/OutputStream;I)I

    const/4 v0, 0x2

    .line 5
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    .line 6
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    iget-object v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    invoke-virtual {v1, v2, v0}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;->a(Ljava/io/OutputStream;I)I

    move-result v0

    if-lez v0, :cond_2

    .line 7
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    iget-boolean v1, v1, Lcom/esfile/screen/recorder/picture/pngj/c;->f:Z

    if-nez v1, :cond_1

    goto :goto_0

    .line 8
    :cond_1
    new-instance v0, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;

    const-string v1, "cannot write palette for this format"

    invoke-direct {v0, v1}, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_2
    :goto_0
    if-nez v0, :cond_4

    .line 9
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    iget-boolean v0, v0, Lcom/esfile/screen/recorder/picture/pngj/c;->g:Z

    if-nez v0, :cond_3

    goto :goto_1

    .line 10
    :cond_3
    new-instance v0, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;

    const-string v1, "missing palette"

    invoke-direct {v0, v1}, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_4
    :goto_1
    const/4 v0, 0x3

    .line 11
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    .line 12
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    iget-object v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    invoke-virtual {v1, v2, v0}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;->a(Ljava/io/OutputStream;I)I

    return-void
.end method

.method private g()V
    .locals 4

    const/4 v0, 0x5

    .line 1
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    .line 2
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->d()V

    .line 3
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    iget v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    invoke-virtual {v0, v1, v2}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;->a(Ljava/io/OutputStream;I)I

    .line 4
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    invoke-virtual {v0}, Lcom/esfile/screen/recorder/picture/pngj/chunks/e;->b()Ljava/util/List;

    move-result-object v0

    .line 5
    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v1

    if-eqz v1, :cond_0

    return-void

    .line 6
    :cond_0
    new-instance v1, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v3, " chunks were not written! Eg: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const/4 v3, 0x0

    .line 7
    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;

    invoke-virtual {v0}, Lcom/esfile/screen/recorder/picture/pngj/chunks/PngChunk;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method private h()V
    .locals 3

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    invoke-static {}, Lcom/esfile/screen/recorder/picture/pngj/f;->a()[B

    move-result-object v1

    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/picture/pngj/f;->a(Ljava/io/OutputStream;[B)V

    const/4 v0, 0x0

    .line 2
    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    .line 3
    new-instance v0, Lcom/esfile/screen/recorder/picture/pngj/chunks/g;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    invoke-direct {v0, v1}, Lcom/esfile/screen/recorder/picture/pngj/chunks/g;-><init>(Lcom/esfile/screen/recorder/picture/pngj/c;)V

    .line 4
    invoke-virtual {v0}, Lcom/esfile/screen/recorder/picture/pngj/chunks/g;->b()Lcom/esfile/screen/recorder/picture/pngj/chunks/c;

    move-result-object v1

    iget-object v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    invoke-virtual {v1, v2}, Lcom/esfile/screen/recorder/picture/pngj/chunks/c;->a(Ljava/io/OutputStream;)V

    .line 5
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->c:Lcom/esfile/screen/recorder/picture/pngj/chunks/e;

    invoke-virtual {v1}, Lcom/esfile/screen/recorder/picture/pngj/chunks/d;->a()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method


# virtual methods
.method protected a(Lcom/esfile/screen/recorder/picture/pngj/c;)Les/fb;
    .locals 1

    .line 24
    new-instance v0, Les/gb;

    invoke-direct {v0, p1}, Les/gb;-><init>(Lcom/esfile/screen/recorder/picture/pngj/c;)V

    return-object v0
.end method

.method public a()V
    .locals 4

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Les/fb;->a()V

    .line 3
    :cond_0
    iget-boolean v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->g:Z

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->j:Ljava/io/OutputStream;

    if-eqz v0, :cond_1

    .line 4
    :try_start_0
    invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 5
    sget-object v1, Lcom/esfile/screen/recorder/picture/pngj/f;->a:Ljava/util/logging/Logger;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Error closing writer "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/util/logging/Logger;->warning(Ljava/lang/String;)V

    :cond_1
    :goto_0
    return-void
.end method

.method public a(I)V
    .locals 1

    .line 7
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {v0, p1}, Les/fb;->a(Ljava/lang/Integer;)V

    return-void
.end method

.method public a(Lcom/esfile/screen/recorder/picture/pngj/FilterType;)V
    .locals 1

    .line 6
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    invoke-virtual {v0, p1}, Les/fb;->a(Lcom/esfile/screen/recorder/picture/pngj/FilterType;)V

    return-void
.end method

.method public a(Lcom/esfile/screen/recorder/picture/pngj/b;)V
    .locals 1

    .line 9
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p0, p1, v0}, Lcom/esfile/screen/recorder/picture/pngj/h;->a(Lcom/esfile/screen/recorder/picture/pngj/b;I)V

    return-void
.end method

.method public a(Lcom/esfile/screen/recorder/picture/pngj/b;I)V
    .locals 3

    .line 10
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    .line 11
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    iget v1, v1, Lcom/esfile/screen/recorder/picture/pngj/c;->b:I

    const/4 v2, 0x0

    if-ne v0, v1, :cond_0

    .line 12
    iput v2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    .line 13
    :cond_0
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    iget v0, v0, Lcom/esfile/screen/recorder/picture/pngj/c;->b:I

    if-ne p2, v0, :cond_1

    const/4 p2, 0x0

    :cond_1
    if-ltz p2, :cond_3

    .line 14
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    if-ne v0, p2, :cond_2

    goto :goto_0

    .line 15
    :cond_2
    new-instance p1, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "rows must be written in order: expected:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, " passed:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2}, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 16
    :cond_3
    :goto_0
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    if-nez v0, :cond_4

    .line 17
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->f:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->f:I

    :cond_4
    if-nez p2, :cond_5

    .line 18
    iget p2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->f:I

    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->e:I

    if-ne p2, v0, :cond_5

    .line 19
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->c()V

    const/4 p2, 0x4

    .line 20
    iput p2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    .line 21
    :cond_5
    iget-object p2, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    invoke-virtual {p2}, Les/fb;->d()[B

    move-result-object p2

    .line 22
    invoke-interface {p1, p2}, Lcom/esfile/screen/recorder/picture/pngj/b;->a([B)V

    .line 23
    iget-object p1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    invoke-virtual {p1, p2}, Les/fb;->b([B)V

    return-void
.end method

.method public a(Z)V
    .locals 0

    .line 8
    iput-boolean p1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->g:Z

    return-void
.end method

.method public b()V
    .locals 2

    .line 1
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->b:I

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->a:Lcom/esfile/screen/recorder/picture/pngj/c;

    iget v1, v1, Lcom/esfile/screen/recorder/picture/pngj/c;->b:I

    add-int/lit8 v1, v1, -0x1

    if-ne v0, v1, :cond_3

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    invoke-virtual {v0}, Les/fb;->g()Z

    move-result v0

    if-eqz v0, :cond_3

    .line 2
    :try_start_0
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    if-eqz v0, :cond_0

    .line 3
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->i:Les/fb;

    invoke-virtual {v0}, Les/fb;->a()V

    .line 4
    :cond_0
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    const/4 v1, 0x5

    if-ge v0, v1, :cond_1

    .line 5
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->g()V

    .line 6
    :cond_1
    iget v0, p0, Lcom/esfile/screen/recorder/picture/pngj/h;->d:I

    const/4 v1, 0x6

    if-ge v0, v1, :cond_2

    .line 7
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->e()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 8
    :cond_2
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->a()V

    return-void

    :catchall_0
    move-exception v0

    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/pngj/h;->a()V

    .line 9
    throw v0

    .line 10
    :cond_3
    new-instance v0, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;

    const-string v1, "all rows have not been written"

    invoke-direct {v0, v1}, Lcom/esfile/screen/recorder/picture/pngj/PngjOutputException;-><init>(Ljava/lang/String;)V

    throw v0
.end method
